<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue 测试实例 - 菜鸟教程(runoob.com)</title>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<style>
.test{
	color:#fff;
    transition: 0.3s;
    background: red;
    width:100px;
}
/* .test:hover{
    background: yellow;
    width:150px;
} */
</style>
</head>
<body>
<div id = "databinding">
<button @click = "clickFn" >点我</button>
    {{show}}
 <p  class="test" :style="show ? 'width:100px':'width:150px'">动画实例</p>

</div>
<script type = "text/javascript">
var vm = new Vue({
el: '#databinding',
    data: {
        show:true,
    },
    methods : {
        clickFn(){
            this.show = !this.show;
        }
    }
});
</script>
</body>
</html>